﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:friction="clr-namespace:Daytimer.Controls.Friction;assembly=Daytimer.Controls">
	<Style x:Key="TextBoxStyle" TargetType="TextBoxBase">
		<Setter Property="BorderThickness" Value="1" />
		<!--<Setter Property="Background" Value="{DynamicResource White}" />-->
		<Setter Property="Background" Value="Transparent" />
		<Setter Property="BorderBrush" Value="#FFABADB3" />
		<Setter Property="SelectionBrush" Value="#FF909090" />
		<Setter Property="SelectionOpacity" Value="0.5" />
		<Setter Property="Foreground" Value="{DynamicResource Black}" />
		<Setter Property="ContextMenu">
			<Setter.Value>
				<ContextMenu>
					<MenuItem Header="Cu_t" Command="ApplicationCommands.Cut" InputGestureText="Ctrl+X">
						<MenuItem.Icon>
							<Image Source="pack://application:,,,/Daytimer.Images;component/Images/cut.png" />
						</MenuItem.Icon>
					</MenuItem>
					<MenuItem Header="_Copy" Command="ApplicationCommands.Copy" InputGestureText="Ctrl+C">
						<MenuItem.Icon>
							<Image Source="pack://application:,,,/Daytimer.Images;component/Images/copy.png" />
						</MenuItem.Icon>
					</MenuItem>
					<MenuItem Header="_Paste" Command="ApplicationCommands.Paste" InputGestureText="Ctrl+V">
						<MenuItem.Icon>
							<Image Source="pack://application:,,,/Daytimer.Images;component/Images/paste_sml.png" />
						</MenuItem.Icon>
					</MenuItem>
					<Separator />
					<MenuItem Header="_Undo" Command="ApplicationCommands.Undo" InputGestureText="Ctrl+Z">
						<MenuItem.Icon>
							<Image Source="pack://application:,,,/Daytimer.Images;component/Images/undo.png" />
						</MenuItem.Icon>
					</MenuItem>
					<MenuItem Header="_Redo" Command="ApplicationCommands.Redo" InputGestureText="Ctrl+Y">
						<MenuItem.Icon>
							<Image Source="pack://application:,,,/Daytimer.Images;component/Images/redo.png" />
						</MenuItem.Icon>
					</MenuItem>
				</ContextMenu>
			</Setter.Value>
		</Setter>
		<Setter Property="Validation.ErrorTemplate" Value="{x:Null}" />
		<Setter Property="VerticalContentAlignment" Value="Center" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TextBoxBase}">
					<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}"
							BorderThickness="{TemplateBinding BorderThickness}"
							Background="{TemplateBinding Background}" SnapsToDevicePixels="True" Padding="0">
						<ScrollViewer x:Name="PART_ContentHost" Focusable="False" HorizontalScrollBarVisibility="Hidden"
								VerticalScrollBarVisibility="Hidden"
								VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsEnabled" Value="False">
							<Setter Property="Opacity" TargetName="border" Value="0.56" />
						</Trigger>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter Property="BorderBrush" Value="#FF7EB4EA" />
						</Trigger>
						<Trigger Property="IsKeyboardFocused" Value="True">
							<Setter Property="BorderBrush" Value="#FF569DE5" />
						</Trigger>
						<Trigger Property="IsReadOnly" Value="True">
							<Setter Property="ContextMenu">
								<Setter.Value>
									<ContextMenu>
										<MenuItem Header="_Copy" Command="ApplicationCommands.Copy"
												InputGestureText="Ctrl+C">
											<MenuItem.Icon>
												<Image
														Source="pack://application:,,,/Daytimer.Images;component/Images/copy.png" />
											</MenuItem.Icon>
										</MenuItem>
									</ContextMenu>
								</Setter.Value>
							</Setter>
						</Trigger>
						<Trigger Property="Validation.HasError" Value="True">
							<Setter Property="BorderBrush" TargetName="border" Value="#FFFF0000" />
							<!--<Setter Property="BorderThickness" TargetName="border" Value="2" />-->
							<Setter Property="ToolTip"
									Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="FocusVisualStyle">
			<Setter.Value>
				<Style />
			</Setter.Value>
		</Setter>
	</Style>
	<Style TargetType="TextBox" BasedOn="{StaticResource TextBoxStyle}">
		<Setter Property="VerticalContentAlignment" Value="Center" />
		<Setter Property="Height" Value="23" />
		<Setter Property="Padding" Value="2,0" />
		<Setter Property="MaxLines" Value="1" />
	</Style>
	<Style TargetType="RichTextBox" BasedOn="{StaticResource TextBoxStyle}" />
</ResourceDictionary>